package com.jcz.web;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;

import com.opensymphony.xwork2.ActionSupport;

public class IsExistUser extends ActionSupport {
	
	private String name;
	private InputStream info;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public InputStream getInfo() {
		return info;
	}
	public void setInfo(InputStream info) {
		this.info = info;
	}
	
	public String execute(){
		String message="";
		if("sa".equals(this.getName())){
			message="用户已存在";
		}else{
			message="用户可用";
		}
		try {
			this.setInfo(new ByteArrayInputStream(message.getBytes("utf-8")));
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return SUCCESS;
	}
}
